﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using WaiShop.BLL.Service;
using WaiShop.Model;
using WaiShop.Models;

namespace WaiShop.Controllers
{
    public class LoginController : Controller
    {

        private IUserInfoService userInfoService;

        public LoginController(IUserInfoService userInfoService)
        {
            this.userInfoService = userInfoService;
        }

        // GET: Login
        /// <summary>
        /// 登录页面
        /// </summary>
        /// <returns></returns>
        public ActionResult Login()
        {
            return View();
        }
        /// <summary>
        /// 注册页面
        /// </summary>
        /// <returns></returns>
        public ActionResult Register()
        {
            return View();
        }

        public JsonResult UserLogin(string UserName,string Pwd) {
            UserInfo user = userInfoService.GetUserInfo(UserName,Pwd);
            return Json(user);
        }
    }
}